from langchain_core.messages import HumanMessage
from langchain_openai import ChatOpenAI

image_url_1 = "https://pic1.zhimg.com/v2-19d657e1f93c77e381205bf64d37ed58_r.jpg"
image_url_2 = "https://img.shetu66.com/2023/11/22/1700641714095150.jpg"
model = ChatOpenAI(model_name="gpt-4o")

message = HumanMessage(content=[
    {"type": "text", "text": "这两张图片是一样的吗？"},
    # 如果图片地址是大模型访问不到的，因为网络问题，那么需要使用base64编码
    {"type":"image_url" , "image_url": {"url": image_url_1}},
    {"type": "image_url", "image_url": {"url": image_url_2}}
])

response = model.invoke([message])
print(response.content)